import { AxiosPromise } from 'axios';
import request from '@/utils/request';

export function recordListAll(customId: string): AxiosPromise<any> {
  return request({
    url: '/wiki/record/listAll',
    method: 'get',
    params: { customId }
  });
}

export function recordList(query: any): AxiosPromise<any> {
  return request({
    url: '/wiki/record/list',
    method: 'get',
    params: query
  });
}

export function recordDetail(id: string): AxiosPromise<any> {
  return request({
    url: '/wiki/record/' + id,
    method: 'get'
  });
}

export function saveRecord(data: any): AxiosPromise<any> {
  return request({
    url: '/wiki/record',
    method: 'post',
    data
  });
}

export function updateRecord(data: any): AxiosPromise<any> {
  return request({
    url: '/wiki/record',
    method: 'put',
    data
  });
}

export function deleteRecord(id: string): AxiosPromise<any> {
  return request({
    url: '/wiki/record/' + id,
    method: 'delete'
  });
}
